﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"  Theme="SkinFile"
    CodeFile="TUser.aspx.cs" Inherits="TUser" Title="系统用户信息管理" Culture="auto" UICulture="auto" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder" runat="Server">
    <script type="text/javascript">
        //上传签名文件。
        function InvokePopUploadParFile(uid)
        {
            var url= 'uploadfile2.aspx?signature&pccid='+'<%=this.btnRefresh.ClientID%>'+'&uid='+uid;
            window.open(url,'上传','height=340,width=600,resizable=yes');             
        } 
    </script>
    
    <h1 id="pagetitle" class="pagetitle">
        系统用户信息管理
        <asp:UpdateProgress ID="UpdateProgress1" runat="server">
            <ProgressTemplate>
                <div class="anistyle" id="ani">
                    正在加载数据，请耐心等待...
                </div>
            </ProgressTemplate>
        </asp:UpdateProgress>
    </h1>
    <asp:UpdatePanel ID="UpdatePanel" runat="server">
        <ContentTemplate>
            <asp:Button ID="btnRefresh" runat="server" Text="隐藏刷新" OnClick="btnRefresh_Click" style="display:none;"/>
            <div class="condition">
                <div class="conditioninput">
                </div>
                <div class="conditionbutton">
                    <asp:Button ID="BtnCreateUser" runat="server" OnClick="BtnCreateUser_Click" Text="创建新用户" />
                </div>
            </div>
            <div runat="server" id="divResult" class="divResult">
                <asp:Label ID="OperationResult" CssClass="result" runat="server" Text=""></asp:Label>
            </div>
            <div class="InfoArea">
                <asp:Panel ID="SummaryPanel" runat="server" Width="100%">
                    <asp:GridView ID="GridView" runat="server" AutoGenerateColumns="False" Width="100%"
                        DataKeyNames="UID" SkinID="gridviewSkin">
                        <Columns>
                            <asp:BoundField DataField="UID" HeaderText="用户ID">
                                <HeaderStyle Width="60px" />
                            </asp:BoundField>
                            <asp:BoundField DataField="Emp_ID" HeaderText="员工编号">
                                <HeaderStyle Width="60px" />
                            </asp:BoundField>
                            <asp:BoundField DataField="Display_Name" HeaderText="显示姓名">
                                <HeaderStyle Width="60px" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="状态">
                                <ItemTemplate>
                                    &nbsp;<asp:Label runat="server" ID="Status" Text='<%#Eval("Status").ToString() == "2" ? "启用" : "禁用"%>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center" Width="60px" />
                            </asp:TemplateField>
                            <asp:BoundField DataField="Create_Time" HeaderText="创建日期">
                                <HeaderStyle Width="100px" />
                            </asp:BoundField>
                            <asp:BoundField DataField="Role_ID" HeaderText="角色编号">
                                <HeaderStyle Width="100px" />
                            </asp:BoundField>
                            <asp:BoundField DataField="Role_Name" HeaderText="角色名称">
                                <HeaderStyle Width="80px" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="签名文件">
                                <HeaderStyle Width="120px" HorizontalAlign="Center" />
                                <ItemStyle HorizontalAlign='Center' />
                                <ItemTemplate>
                                <div style='<%# Eval("SignaturePic").ToString()!=""?"":"display:none;"%>'>
                                    <a href='getfile.aspx?fileid=<%# Eval("SignaturePic")%>'>签名图片</a>
                                    <asp:ImageButton ImageUrl="images/cross.gif" runat="server" ID="btnDeleteFile" OnClick="btnDeleteFile_Click" />
                                </div>
                                <div style='<%# Eval("SignaturePic").ToString()==""?"":"display:none;"%>'>
                                    <a href="#" onclick="javascript:InvokePopUploadParFile('<%#Eval("UID").ToString()%>');">上传签名</a>
                                </div>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="操作">
                                <HeaderStyle Width="120px" HorizontalAlign="Center" />
                                <ItemStyle HorizontalAlign='Center' />
                                <ItemTemplate>
                                    <asp:LinkButton ID="GvEdit" runat="server" OnClick="GvEdit_Click">编辑</asp:LinkButton>
                                    <asp:LinkButton ID="GvDelete" runat="server" OnClick="GvDelete_Click" OnClientClick="javascript:return confirm('您确定要删除此条记录吗？');">删除</asp:LinkButton>
                                    <asp:LinkButton ID="GvDetail" runat="server" OnClick="GvDetail_Click">详细</asp:LinkButton>
                                    <asp:LinkButton ID="GvEnabled" runat="server" OnClick="GvEnabled_Click" Text='<%#Eval("Status").ToString() == "1" ? "启用" : "禁用"%>'></asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </asp:Panel>
                <asp:Panel ID="EditPanel" runat="server" Width="100%">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tablehaveborder">
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; height: 24px;">
                                &nbsp;&nbsp;用户ID：</td>
                            <td style="width: 400px;">
                                <asp:Label ID="EditUID" runat="server" Width="100%" class="id"></asp:Label>
                            </td>
                            <td style="width: 150px;">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; height: 24px;">
                                &nbsp;&nbsp;所属部门：</td>
                            <td style="width: 400px;">
                                <asp:DropDownList ID="EditDept_ID" runat="server" Width="99%" AutoPostBack="True"
                                    OnSelectedIndexChanged="EditDept_ID_SelectedIndexChanged">
                                </asp:DropDownList></td>
                            <td style="width: 150px;">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; height: 24px;">
                                &nbsp;&nbsp;员工姓名：</td>
                            <td style="width: 400px;">
                                <asp:DropDownList ID="EditEmp_ID" runat="server" Width="99%">
                                </asp:DropDownList></td>
                            <td style="width: 150px;">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; height: 24px;">
                                &nbsp;&nbsp;显示姓名：</td>
                            <td style="width: 400px;">
                                <asp:TextBox ID="EditDisplay_Name" runat="server" Width="99%"></asp:TextBox>
                            </td>
                            <td style="width: 150px;">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; height: 24px;">
                                &nbsp;&nbsp;口令：
                            </td>
                            <td style="width: 400px;">
                                <asp:TextBox ID="EditPWD" runat="server" Width="99%" MaxLength="50" TextMode="Password"></asp:TextBox>
                            </td>
                            <td style="width: 150px;">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; height: 24px;">
                                &nbsp;&nbsp;口令确认：</td>
                            <td style="width: 400px;">
                                <asp:TextBox ID="EditPWDConfirm" runat="server" Width="99%" MaxLength="50" TextMode="Password"></asp:TextBox></td>
                            <td style="width: 150px;">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; height: 24px;">
                                &nbsp; 状态：</td>
                            <td style="width: 400px;">
                                <asp:DropDownList ID="EditStatus" runat="server" Width="99%">
                                    <asp:ListItem Value="2">正常</asp:ListItem>
                                    <asp:ListItem Value="1">禁用</asp:ListItem>
                                </asp:DropDownList></td>
                            <td style="width: 150px;">
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; height: 24px;">
                                &nbsp;&nbsp;用户组：
                            </td>
                            <td style="width: 400px;">
                                <asp:DropDownList ID="EditUserGroup" runat="server" Width="99%">
                                </asp:DropDownList></td>
                            <td style="width: 150px;">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                                <asp:HiddenField ID="HFEditRoleID" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <td class="tblfooter" colspan="3" align="right">
                                <asp:Button ID="EditSave" runat="server" Text="保 存" Width="90px" OnClick="EditSave_Click"
                                    ValidationGroup="Edit" />
                                <asp:Button ID="EditBack" runat="server" Text="返 回" Width="90px" OnClick="EditBack_Click" /></td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
                <asp:Panel ID="CreatePanel" runat="server" Width="100%">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tablehaveborder">
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr style="height: 24px;">
                            <td colspan="3">
                                &nbsp; *创建用户即是允许某个员工登录。</td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; height: 24px;">
                                &nbsp;&nbsp;所属部门：</td>
                            <td style="width: 400px;">
                                <asp:DropDownList ID="CreateDept_ID" runat="server" Width="99%" AutoPostBack="True"
                                    OnSelectedIndexChanged="CreateDept_ID_SelectedIndexChanged">
                                </asp:DropDownList></td>
                            <td style="width: 150px;">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; height: 24px;">
                                &nbsp;&nbsp;员工姓名：</td>
                            <td style="width: 400px;">
                                <asp:DropDownList ID="CreateEmp_ID" runat="server" Width="99%" ValidationGroup="Create"
                                    AutoPostBack="True" OnSelectedIndexChanged="CreateEmp_ID_SelectedIndexChanged">
                                </asp:DropDownList></td>
                            <td style="width: 150px;">
                                &nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="CreateEmp_ID"
                                    ErrorMessage="请选择员工姓名!" ValidationGroup="Create"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; height: 24px;">
                                &nbsp;&nbsp;显示姓名：</td>
                            <td style="width: 400px;">
                                <asp:TextBox ID="CreateDisplay_Name" runat="server" Width="99%"></asp:TextBox>
                            </td>
                            <td style="width: 150px;">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; height: 24px;">
                                &nbsp;&nbsp;口令：</td>
                            <td style="width: 400px;">
                                <asp:TextBox ID="CreatePWD" runat="server" Width="99%" MaxLength="50" TextMode="Password"></asp:TextBox>
                            </td>
                            <td style="width: 150px;">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; height: 24px;">
                                &nbsp;&nbsp;口令确认：</td>
                            <td style="width: 400px;">
                                <asp:TextBox ID="CreatePWDConfirm" runat="server" Width="99%" MaxLength="50" TextMode="Password"></asp:TextBox>
                            </td>
                            <td style="width: 150px;">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; height: 24px;">
                                &nbsp;&nbsp;用户组：
                            </td>
                            <td style="width: 400px;">
                                <asp:DropDownList ID="CreateUserGroup" runat="server" Width="99%">
                                </asp:DropDownList></td>
                            <td style="width: 150px;">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td class="tblfooter" colspan="3" align="right">
                                &nbsp;<asp:Button ID="CreateSave" runat="server" Text="保 存" Width="90px" OnClick="CreateSave_Click"
                                    ValidationGroup="Create" />
                                <asp:Button ID="CreateBack" runat="server" Text="返 回" Width="90px" OnClick="CreateBack_Click" /></td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
                <asp:Panel ID="DetailPanel" runat="server" Width="100%">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tablehaveborder">
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; height: 24px;">
                                &nbsp;&nbsp;用户ID：</td>
                            <td style="width: 400px;">
                                <asp:Label ID="DetailUID" runat="server" Width="100%" class="id"></asp:Label>
                            </td>
                            <td style="width: 150px;">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; height: 24px;">
                                &nbsp;&nbsp;所属部门：</td>
                            <td style="width: 400px;">
                                <asp:Label ID="DetailDept_ID" runat="server" Width="100%"></asp:Label>
                            </td>
                            <td style="width: 150px;">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; height: 24px;">
                                &nbsp;&nbsp;员工姓名：</td>
                            <td style="width: 400px;">
                                <asp:Label ID="DetailEmp_ID" runat="server" Width="100%"></asp:Label>
                            </td>
                            <td style="width: 150px;">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; height: 24px;">
                                &nbsp;&nbsp;显示姓名：</td>
                            <td style="width: 400px;">
                                <asp:Label ID="DetailDisplay_Name" runat="server" Width="100%"></asp:Label>
                            </td>
                            <td style="width: 150px;">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; height: 24px;">
                                &nbsp;&nbsp;签名图片：</td>
                            <td style="width: 400px;">
                                <asp:Image runat="server" ID="DetailDisplay_SignaturePic"/>
                            </td>
                            <td style="width: 150px;">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; height: 24px;">
                                &nbsp;&nbsp;口令：
                            </td>
                            <td style="width: 400px;">
                                <asp:Label ID="DetailPWD" runat="server" Width="100%"></asp:Label>
                            </td>
                            <td style="width: 150px;">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; height: 24px;">
                                &nbsp;&nbsp;状态：</td>
                            <td style="width: 400px;">
                                <asp:Label ID="DetailStatus" runat="server" Width="100%"></asp:Label>
                            </td>
                            <td style="width: 150px;">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; height: 24px;">
                                &nbsp;&nbsp;用户组：</td>
                            <td style="width: 400px;">
                                <asp:Label ID="DetailUserGroup" runat="server" Width="100%"></asp:Label>
                            </td>
                            <td style="width: 150px;">
                                &nbsp;
                                <asp:HiddenField ID="HDDetailRoleID" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; height: 24px;">
                                &nbsp;&nbsp;创建时间：</td>
                            <td style="width: 400px;">
                                <asp:Label ID="DetailCreate_Time" runat="server" Width="100%"></asp:Label>
                            </td>
                            <td style="width: 150px;">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; height: 24px;">
                                &nbsp;&nbsp;更新时间：</td>
                            <td style="width: 400px;">
                                <asp:Label ID="DetailUpdate_Time" runat="server" Width="100%"></asp:Label>
                            </td>
                            <td style="width: 150px;">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td class="tblfooter" colspan="3">
                                <asp:Button ID="EditGo" runat="server" Text="修 改" Width="90px" OnClick="EditGo_Click" />
                                <asp:Button ID="DeleteGo" runat="server" OnClientClick="javascript:return confirm('您确定要删除此条记录吗？');"
                                    Text="删 除" Width="90px" OnClick="DeleteGo_Click" />
                                <asp:Button ID="DetailBack" runat="server" Text="返 回" Width="90px" OnClick="DetailBack_Click" /></td>
                        </tr>
                        <tr>
                            <td style="height: 1px; background-color: #F0F0F0;" colspan="3">
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
